﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using System.Data;
using WMS.DBUtility;

namespace WMS.BLL
{
    public class WhsWhs
    {
        public List<WMS.Model.WhsWhs> GetByCTMan(string ctMan)
        {
            string strSql = String.Format("SELECT WHS_WHS,WHS_PNO,CTMAN FROM WHSPOS WHERE CTMAN='{0}'", ctMan);
            DataSet ds = DbHelperSQL.ExecuteSqlStringDataSet(strSql);
            List<WMS.Model.WhsWhs> lst = new List<Model.WhsWhs>();

            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                foreach (DataRow row in ds.Tables[0].Rows)
                {
                    WMS.Model.WhsWhs itm = new Model.WhsWhs();
                    itm.Whs_Whs = row["WHS_WHS"].ToString();
                    itm.Whs_Pno = row["WHS_PNO"].ToString();
                    itm.CTMan = row["CTMan"].ToString();

                    lst.Add(itm);
                }
            }

            return lst;
        }
    }
}
